package adapter;

import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.widget.Button;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import bean.CourseraInfoBean;
import bean.ScheduleTableBean;
import student.andlei.com.student.R;


public class CourseraInfoAdapter extends BaseQuickAdapter<ScheduleTableBean.Rooms,BaseViewHolder> {
    public CourseraInfoAdapter(int layoutResId, @Nullable List data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ScheduleTableBean.Rooms item) {
        helper.setText(R.id.tv_prelude,item.serial);
        helper.setText(R.id.tv_title,item.room_name);
        helper.setText(R.id.tv_time,item.room_date+"       "+item.start_time+"--"+item.end_time);
        helper.addOnClickListener(R.id.bt_);
        Button button = helper.getView(R.id.bt_);
        //1:暂未开始 2:进入课堂 3.查看录播 4：录播暂未上传
        switch (item.classroom_status){
            case 1:
                button.setText("进入课堂");
                button.setBackgroundResource(R.drawable.bt_yellow_click);
                break;
            case 2:
                button.setText("进入课堂");
                button.setBackgroundResource(R.drawable.bt_yellow_click);
                break;
            case 3:
                button.setText("查看录播");
                button.setBackgroundResource(R.drawable.bt_click);
                break;
            case 4:
                button.setText("查看录播");
                button.setBackgroundResource(R.drawable.bt_click);
                break;
        }
    }


}
